package com.example.springmvcdemo;

import org.springframework.web.bind.annotation.*;

/**
 * @author Q
 * @create 2025-05-21-19:49
 */
@RestController
public class UserController {
    @RequestMapping("/hello")
    public String hello() {
        return "hello Spring MVC";
    }
    //仅支持post&get
    @RequestMapping(value = "/hello2",method = {RequestMethod.GET,RequestMethod.POST})
    public String hello2() {
        return "hello Spring MVC";
    }
    //指定POST
    @PostMapping("/hello3")
    public String hello3() {
        return "hello Spring MVC";
    }
    //指定GEt
    @GetMapping ("/hello4")
    public String hello4() {
        return "hello Spring MVC";
    }
}
